package com.ugoodtech.mdcc.client.service;

import com.ugoodtech.mdcc.client.Utils.PageInfoWrapper;
import com.ugoodtech.mdcc.client.dto.PerformancePlanRequestVO;
import com.ugoodtech.mdcc.client.dto.PerformancePlanVO;
import com.ugoodtech.mdcc.core.domain.PerformanceReport;

import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.multipart.MultipartFile;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by Lance Li on 2020/2/17.
 *
 * @author Lance Li
 */
public interface PerformancePlanService {

	PerformancePlanVO resolvePlanExcel(MultipartFile file);

	/**
	 * 获取业绩报告可以查看的年份
	 *
	 * @return 年份列表
	 */
	List<Integer> getYears();

	PageInfoWrapper getYearPlanPage(Integer year, String username, List<Integer> months,
                                    Integer pageIndex, Integer pageSize);

	PerformancePlanVO getYearPlan(Integer year, String username, List<Integer> months,
                                  Integer pageIndex, Integer pageSize);

	List<PerformancePlanVO> getPlan(Integer year, String username, List<Integer> months, Integer pageIndex, Integer pageSize, boolean latest);

	PerformanceReport getPlan(Long reportId);

	/**
	 * 获取那些需要输入的业绩报告数据
	 */
	PerformancePlanVO getDataNeedInput(Integer year);

	PageInfoWrapper getMonthPlanPage(Integer year, String username, List<Integer> months,
									 Integer pageIndex, Integer pageSize);

	List<PerformancePlanVO> getMonthPlan(Integer year, String username, List<Integer> months, Integer pageIndex, Integer pageSize);

	/**
	 * 查找当前用户业绩报告年份信息
	 */
	List<Integer> getYearGroupInfo();

	void addOrUpdatePerformancePlan(String regionManager, String plotManager, Integer year,
                                    List<PerformancePlanRequestVO.PerformancePlanSpecificData> performancePlanSpecificData);

	/**
	 * 添加或编辑业绩
	 */
	void addOrUpdatePerformancePlan(String regionManager, String plotManager, Integer year,
                                    Integer operationType,
                                    List<BigDecimal> VRPCollectionValue, List<BigDecimal> VRPNotCollectionValue,
                                    List<BigDecimal> WandaCollectionValue, List<BigDecimal> WandaNotCollectionValue);

	Workbook changeYear(Workbook workbook, Integer year);

}
